package com.wcll.servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.wcll.bean.CQM_JianLi;

public class CQM_YiXiangServlet extends HttpServlet {

	
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
CQM_JianLi jianli=new CQM_JianLi();
response.setContentType("text/html; charset=UTF-8");
request.setCharacterEncoding("UTF-8");

	    List li=new ArrayList();
		
		String name=request.getParameter("name");
		String sex=request.getParameter("sex");
	    String email=request.getParameter("email");
		String phone=request.getParameter("phone");
	    String zhuzhi=request.getParameter("zhuzhi");
	    String sheng=request.getParameter("sheng");
	    String shi=request.getParameter("shi");
	    String xian=request.getParameter("xian");
	    String gongzi=request.getParameter("gongzi");
	    String desc=request.getParameter("desc");
	    String xuexiaoname=request.getParameter("xuexiaoname");
	    String zhuanyename=request.getParameter("zhuanyename");
	    String xueli=request.getParameter("xueli");
	    String waiyu=request.getParameter("waiyu");
	    String nengli=request.getParameter("nengli");
	    String jiangxiang=request.getParameter("jiangxiang");
	    String desc1=request.getParameter("desc1");
	    String shijianname=request.getParameter("shijianname");
	    String desc2=request.getParameter("desc2");
	    request.getSession().setAttribute("sheng", sheng);
	    request.getSession().setAttribute("shi", shi);
	    request.getSession().setAttribute("xian", xian);
	    request.getSession().setAttribute("gongzi", gongzi);
	    request.getSession().setAttribute("desc", desc);
	    
	    
	    
	     jianli.setName(name);
	     jianli.setEmail(email);
	     jianli.setPhone(phone);
	     jianli.setSex(sex);
	     jianli.setZhuzhi(zhuzhi);
	     jianli.setSheng(sheng);
	     jianli.setShi(shi);
	     jianli.setXian(xian);
	     jianli.setGongzi(gongzi);
	     jianli.setDesc(desc);
	     jianli.setXuexiaoname(xuexiaoname);
	     jianli.setZhuanyename(zhuanyename);
	     jianli.setXueli(xueli);
	     jianli.setWaiyu(waiyu);
	     jianli.setNengli(nengli);
	     jianli.setJiangxiang(jiangxiang);
	     jianli.setDesc1(desc1);
	     jianli.setShijianname(shijianname);
	     jianli.setDesc2(desc2);
		 request.getSession().getAttribute("zhi");
		 request.getParameter("id1");
		 String aa=(String)request.getSession().getAttribute("user1");
		 String bb=(String)request.getSession().getAttribute("loginname");
		 String fff=(String)request.getSession().getAttribute("cishu");
		 String s=(String)request.getSession().getAttribute("zhi");
		 String ss=(String)request.getSession().getAttribute("hang");
		
		 
	    try {
			jianli.yiXiang(jianli,s,ss,aa,bb,fff);
			this.getServletContext().getRequestDispatcher("/cqm_gongJiao.jsp")
			.forward(request, response);
		}   catch (SQLException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}  catch (ClassNotFoundException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		
		
	}

	
	public void init() throws ServletException {
		// Put your code here
	}

}
